.row
  .panel.panel-primary
    .panel-heading
      span = t('.search')
    .panel-body
      = form_tag admin_members_path, method: :get do |f|
        .col-xs-3 = select_tag :search_field, options_for_select([ \
            [t('.email'), 'email'],                                \
            [t('.name'),  'name'],                                 \
            [t('.phone'), 'phone_number'],                         \
            [t('.wallet_address'), 'wallet_address'],              \
          ], @search_field)
        .col-xs-4 = text_field_tag :search_term, @search_term
        .col-xs-3.col-xs-offset-1 = submit_tag t('.search')

.row
  .panel.panel-primary
    .panel-heading
      span = t('.members')
    .panel-body
      = table_for(@members, class: 'table table-condensed table-hover') do |t|
        - t.column :id, class: 'col-xs-1'
        - t.column :email, class: 'col-xs-2' do |x|
          code.text-info = x.email
        - t.column :created_at, class: 'col-xs-3'
        - t.column :activated?, class: 'col-xs-1' do |x|
          = yesno x.activated?
        - t.column 'Disabled? (Web/API)', class: 'col-xs-1' do |x|
          - text = x.disabled? ? 'Yes' : 'No'
          = link_to text, toggle_admin_member_path(x), remote: true, method: :post, class: 'toggle-web'
          | &nbsp;/&nbsp;
          - text = x.api_disabled? ? 'Yes' : 'No'
          = link_to text, toggle_admin_member_path(x, api: true), remote: true, method: :post, class: 'toggle-api'
        - t.column :id_document_verified?, class: 'col-xs-2' do |x|
          = x.id_document_verified? ? x.name : yesno(x.id_document_verified?)
        - t.column :actions, class: 'col-xs-1' do |x|
          = link_to t('actions.view'), url_for([:admin, x]), target: '_blank'

      = paginate @members

